import axios from "@/utils/axios";
//加密算法
import { shaCrypto } from '../utils/crypto';
// ------------------------------文件存证接口---------------------------------------
/*
  文件存证列表
*/
export const getEvidenceFile = (parmas) => {
    return axios.get("/evidence/file/query", parmas);
};
/*
  文件存证
*/
export const createEvidenceFile = (body) => {
    const headers = {
        "Content-Type": "multipart/form-data",
    }
    return axios.post("/evidence/file/create", body, headers);
};
/*
 哈希类文件存证接口
*/
export const createEvidenceFileHash = (body) => {
    return axios.post("/evidence/file/hash/create", body);
};
/*
 存证明细接口
*/
export const detailEvidenceFile = (evidenceId) => {
    return axios.get("/evidence/file/detail", evidenceId);
};
/*
 解密接口
*/
export const evidenceFileDecrypt = (body) => {
    body['password'] = shaCrypto(body['password'] + 'icep1029!@');
    return axios.post("/evidence/file/decrypt", body);
};


// ------------------------------数据存证接口---------------------------------------
/*
  存证列表接口
*/
export const getEvidenceDataFile = (parmas) => {
    return axios.get("/evidence/data/query", parmas);
};
/*
  数据存证
*/
export const createEvidenceDataFile = (body) => {
    return axios.post("/evidence/data/create", body);
};
/*
 存证明细接口
*/
export const detailEvidenceDataFile = (evidenceId) => {
    return axios.get("/evidence/data/detail", evidenceId);
};
/*
 解密接口
*/
export const evidenceFileDataDecrypt = (body) => {
    body['password'] = shaCrypto(body['password'] + 'icep1029!@');
    return axios.post("/evidence/data/decrypt", body);
};
/*
 验签接口
*/
export const evidenceSignatureDecrypt = (body) => {
    return axios.post("/evidence/signature/check", body);
};